﻿using System;
using Microsoft.Practices.Composite.Presentation.Commands;
using Microsoft.Practices.Unity;
using Refract;
using Refract.Views;

namespace Refract.Demo.Module2.Views
{
    public class GoodByeViewModel : ViewModel<GoodBye>
    {
        [Dependency]
        public INavigator Navigation { get; set; }

        public DelegateCommand<String> CloseCommand { get; set; }

        public GoodByeViewModel()
            : base("GoodBye")
        {
            CloseCommand = new DelegateCommand<string>(CloseView, p => { return true; });
        }
        private void CloseView(string obj)
        {
            Navigation.Clear();
        }
    }
}
